import React from 'react';
import { Route, Switch } from 'react-router-dom';
// import Loadable from 'react-loadable';
import loadable from 'loadable-components';

import NotFound from './notFound';

const Home = loadable(() => import('./home'));
const HookDemo = loadable(() => import('./hookDemo'));
const ReduxDemo = loadable(() => import('./reduxDemo'));

export default () => (
  <Switch>
    <Route exact path="/" component={Home} />
    <Route exact path="/hook" component={HookDemo} />
    <Route exact path="/redux" component={ReduxDemo} />

    <Route component={NotFound} />
  </Switch>
);
